<!-- HTML header for doxygen 1.8.14-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="cache-control" content="max-age=86400"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GBDK 2020 Docs: gbdk-lib/include/gb/sgb.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">GBDK 2020 Docs
   &#160;<span id="projectnumber">4.4.0</span>
   </div>
   <div id="projectbrief">API Documentation for GBDK 2020</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('sgb_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">sgb.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;types.h&gt;</code><br />
<code>#include &lt;<a class="el" href="stdint_8h_source.html">stdint.h</a>&gt;</code><br />
</div>
<p><a href="sgb_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a70bdb512d109fbcaeb95efa32e9dcaf5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a70bdb512d109fbcaeb95efa32e9dcaf5">SGB_PAL_01</a>&#160;&#160;&#160;0x00U</td></tr>
<tr class="separator:a70bdb512d109fbcaeb95efa32e9dcaf5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acaa2f1ac9949189896582fc5ad0823b1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#acaa2f1ac9949189896582fc5ad0823b1">SGB_PAL_23</a>&#160;&#160;&#160;0x01U</td></tr>
<tr class="separator:acaa2f1ac9949189896582fc5ad0823b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af9e1ca804555fad619db3f38b62a49e8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#af9e1ca804555fad619db3f38b62a49e8">SGB_PAL_03</a>&#160;&#160;&#160;0x02U</td></tr>
<tr class="separator:af9e1ca804555fad619db3f38b62a49e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8d633d52d4a7adfaef516953d5e8552a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a8d633d52d4a7adfaef516953d5e8552a">SGB_PAL_12</a>&#160;&#160;&#160;0x03U</td></tr>
<tr class="separator:a8d633d52d4a7adfaef516953d5e8552a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6437bd5982922fffdbc7c5d8c643e357"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a6437bd5982922fffdbc7c5d8c643e357">SGB_ATTR_BLK</a>&#160;&#160;&#160;0x04U</td></tr>
<tr class="separator:a6437bd5982922fffdbc7c5d8c643e357"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade5ba9723a9964e55cff72108149037a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#ade5ba9723a9964e55cff72108149037a">SGB_ATTR_LIN</a>&#160;&#160;&#160;0x05U</td></tr>
<tr class="separator:ade5ba9723a9964e55cff72108149037a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adcb3f50616813637283f88bfd4d53e22"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#adcb3f50616813637283f88bfd4d53e22">SGB_ATTR_DIV</a>&#160;&#160;&#160;0x06U</td></tr>
<tr class="separator:adcb3f50616813637283f88bfd4d53e22"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a41981a213b67bdc45bf8ed78f07e7bba"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a41981a213b67bdc45bf8ed78f07e7bba">SGB_ATTR_CHR</a>&#160;&#160;&#160;0x07U</td></tr>
<tr class="separator:a41981a213b67bdc45bf8ed78f07e7bba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a42e0fbc58e65874e0a76d7f33a322ce8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a42e0fbc58e65874e0a76d7f33a322ce8">SGB_SOUND</a>&#160;&#160;&#160;0x08U</td></tr>
<tr class="separator:a42e0fbc58e65874e0a76d7f33a322ce8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a82a976ea6a32ae0078a27e3c06143bcf"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a82a976ea6a32ae0078a27e3c06143bcf">SGB_SOU_TRN</a>&#160;&#160;&#160;0x09U</td></tr>
<tr class="separator:a82a976ea6a32ae0078a27e3c06143bcf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad9023ed1d8dd4a2eebc55a376207f3d2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#ad9023ed1d8dd4a2eebc55a376207f3d2">SGB_PAL_SET</a>&#160;&#160;&#160;0x0AU</td></tr>
<tr class="separator:ad9023ed1d8dd4a2eebc55a376207f3d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac490ce8566f869727e8b00fabb1c9fc6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#ac490ce8566f869727e8b00fabb1c9fc6">SGB_PAL_TRN</a>&#160;&#160;&#160;0x0BU</td></tr>
<tr class="separator:ac490ce8566f869727e8b00fabb1c9fc6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d81b1e455d60d760ee58e2685953775"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a3d81b1e455d60d760ee58e2685953775">SGB_ATRC_EN</a>&#160;&#160;&#160;0x0CU</td></tr>
<tr class="separator:a3d81b1e455d60d760ee58e2685953775"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e644a43af63932283e9c78a472881dc"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a8e644a43af63932283e9c78a472881dc">SGB_TEST_EN</a>&#160;&#160;&#160;0x0DU</td></tr>
<tr class="separator:a8e644a43af63932283e9c78a472881dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a46440df1df1597852a286d56c1a68a48"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a46440df1df1597852a286d56c1a68a48">SGB_ICON_EN</a>&#160;&#160;&#160;0x0EU</td></tr>
<tr class="separator:a46440df1df1597852a286d56c1a68a48"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae4fe10a0c9eca38d126f3a8701e3c9a2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#ae4fe10a0c9eca38d126f3a8701e3c9a2">SGB_DATA_SND</a>&#160;&#160;&#160;0x0FU</td></tr>
<tr class="separator:ae4fe10a0c9eca38d126f3a8701e3c9a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a862a450451cfccf138311089b85292fc"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a862a450451cfccf138311089b85292fc">SGB_DATA_TRN</a>&#160;&#160;&#160;0x10U</td></tr>
<tr class="separator:a862a450451cfccf138311089b85292fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a70aad9e5786ca8a4753c47583e88f8a2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a70aad9e5786ca8a4753c47583e88f8a2">SGB_MLT_REQ</a>&#160;&#160;&#160;0x11U</td></tr>
<tr class="separator:a70aad9e5786ca8a4753c47583e88f8a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac4217b88053614f70af5b1f32e72870"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#aac4217b88053614f70af5b1f32e72870">SGB_JUMP</a>&#160;&#160;&#160;0x12U</td></tr>
<tr class="separator:aac4217b88053614f70af5b1f32e72870"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af4d8b611dfdda33039038375ee95f424"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#af4d8b611dfdda33039038375ee95f424">SGB_CHR_TRN</a>&#160;&#160;&#160;0x13U</td></tr>
<tr class="separator:af4d8b611dfdda33039038375ee95f424"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac0bf9d5dc54d711fd14f44bf58eaa5db"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#ac0bf9d5dc54d711fd14f44bf58eaa5db">SGB_PCT_TRN</a>&#160;&#160;&#160;0x14U</td></tr>
<tr class="separator:ac0bf9d5dc54d711fd14f44bf58eaa5db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1762d2df2599cf864400bac4934a5d61"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a1762d2df2599cf864400bac4934a5d61">SGB_ATTR_TRN</a>&#160;&#160;&#160;0x15U</td></tr>
<tr class="separator:a1762d2df2599cf864400bac4934a5d61"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf8d94c42e97e1ce640340657df70640"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#abf8d94c42e97e1ce640340657df70640">SGB_ATTR_SET</a>&#160;&#160;&#160;0x16U</td></tr>
<tr class="separator:abf8d94c42e97e1ce640340657df70640"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20477d5772564b63de2d151e062dd5a7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a20477d5772564b63de2d151e062dd5a7">SGB_MASK_EN</a>&#160;&#160;&#160;0x17U</td></tr>
<tr class="separator:a20477d5772564b63de2d151e062dd5a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b76bf1e9ac81da97c533fa3ab12096c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a3b76bf1e9ac81da97c533fa3ab12096c">SGB_OBJ_TRN</a>&#160;&#160;&#160;0x18U</td></tr>
<tr class="separator:a3b76bf1e9ac81da97c533fa3ab12096c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aebb918368f98572ffe4c439854cad191"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#aebb918368f98572ffe4c439854cad191">sgb_check</a> (void) <a class="el" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a> <a class="el" href="asm_2types_8h.html#acb825e83a33fcc06482c59b4ab2cf961">PRESERVES_REGS</a>(<a class="el" href="sms_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a></td></tr>
<tr class="separator:aebb918368f98572ffe4c439854cad191"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a84e1f2ab7dce1faabd3d271b6bf8df8c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a84e1f2ab7dce1faabd3d271b6bf8df8c">sgb_transfer</a> (<a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *packet) <a class="el" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a> <a class="el" href="asm_2types_8h.html#acb825e83a33fcc06482c59b4ab2cf961">PRESERVES_REGS</a>(<a class="el" href="sms_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a></td></tr>
<tr class="separator:a84e1f2ab7dce1faabd3d271b6bf8df8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a0b3366755f3276b0243c1e0497471b7a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a0b3366755f3276b0243c1e0497471b7a">c</a></td></tr>
<tr class="separator:a0b3366755f3276b0243c1e0497471b7a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Super Gameboy definitions.</p>
<p>See the example SGB project for additional details. </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a70bdb512d109fbcaeb95efa32e9dcaf5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a70bdb512d109fbcaeb95efa32e9dcaf5">&#9670;&nbsp;</a></span>SGB_PAL_01</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_PAL_01&#160;&#160;&#160;0x00U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Set SGB Palettes 0 &amp; 1 </p>

</div>
</div>
<a id="acaa2f1ac9949189896582fc5ad0823b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acaa2f1ac9949189896582fc5ad0823b1">&#9670;&nbsp;</a></span>SGB_PAL_23</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_PAL_23&#160;&#160;&#160;0x01U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Set SGB Palettes 2 &amp; 3 </p>

</div>
</div>
<a id="af9e1ca804555fad619db3f38b62a49e8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af9e1ca804555fad619db3f38b62a49e8">&#9670;&nbsp;</a></span>SGB_PAL_03</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_PAL_03&#160;&#160;&#160;0x02U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Set SGB Palettes 0 &amp; 3 </p>

</div>
</div>
<a id="a8d633d52d4a7adfaef516953d5e8552a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8d633d52d4a7adfaef516953d5e8552a">&#9670;&nbsp;</a></span>SGB_PAL_12</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_PAL_12&#160;&#160;&#160;0x03U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Set SGB Palettes 1 &amp; 2 </p>

</div>
</div>
<a id="a6437bd5982922fffdbc7c5d8c643e357"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6437bd5982922fffdbc7c5d8c643e357">&#9670;&nbsp;</a></span>SGB_ATTR_BLK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_ATTR_BLK&#160;&#160;&#160;0x04U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Set color attributes for rectangular regions </p>

</div>
</div>
<a id="ade5ba9723a9964e55cff72108149037a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ade5ba9723a9964e55cff72108149037a">&#9670;&nbsp;</a></span>SGB_ATTR_LIN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_ATTR_LIN&#160;&#160;&#160;0x05U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Set color attributes for horizontal or vertical character lines </p>

</div>
</div>
<a id="adcb3f50616813637283f88bfd4d53e22"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adcb3f50616813637283f88bfd4d53e22">&#9670;&nbsp;</a></span>SGB_ATTR_DIV</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_ATTR_DIV&#160;&#160;&#160;0x06U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Split screen in half and assign separate color attribes to each side and the divider </p>

</div>
</div>
<a id="a41981a213b67bdc45bf8ed78f07e7bba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a41981a213b67bdc45bf8ed78f07e7bba">&#9670;&nbsp;</a></span>SGB_ATTR_CHR</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_ATTR_CHR&#160;&#160;&#160;0x07U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Set color attributes for separate charactersSet SGB Palette 0,1 Data </p>

</div>
</div>
<a id="a42e0fbc58e65874e0a76d7f33a322ce8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a42e0fbc58e65874e0a76d7f33a322ce8">&#9670;&nbsp;</a></span>SGB_SOUND</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_SOUND&#160;&#160;&#160;0x08U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Start and stop a internal sound effect, and sounds using internal tone data </p>

</div>
</div>
<a id="a82a976ea6a32ae0078a27e3c06143bcf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a82a976ea6a32ae0078a27e3c06143bcf">&#9670;&nbsp;</a></span>SGB_SOU_TRN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_SOU_TRN&#160;&#160;&#160;0x09U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Transfer sound code or data to the SNES APU RAM </p>

</div>
</div>
<a id="ad9023ed1d8dd4a2eebc55a376207f3d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad9023ed1d8dd4a2eebc55a376207f3d2">&#9670;&nbsp;</a></span>SGB_PAL_SET</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_PAL_SET&#160;&#160;&#160;0x0AU</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Apply (previously transferred) SGB system color palettes to actual SNES palettes </p>

</div>
</div>
<a id="ac490ce8566f869727e8b00fabb1c9fc6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac490ce8566f869727e8b00fabb1c9fc6">&#9670;&nbsp;</a></span>SGB_PAL_TRN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_PAL_TRN&#160;&#160;&#160;0x0BU</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Transfer palette data into SGB system color palettes </p>

</div>
</div>
<a id="a3d81b1e455d60d760ee58e2685953775"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3d81b1e455d60d760ee58e2685953775">&#9670;&nbsp;</a></span>SGB_ATRC_EN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_ATRC_EN&#160;&#160;&#160;0x0CU</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Enable/disable Attraction mode. It is enabled by default </p>

</div>
</div>
<a id="a8e644a43af63932283e9c78a472881dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8e644a43af63932283e9c78a472881dc">&#9670;&nbsp;</a></span>SGB_TEST_EN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_TEST_EN&#160;&#160;&#160;0x0DU</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Enable/disable test mode for "SGB-CPU variable clock speed function" </p>

</div>
</div>
<a id="a46440df1df1597852a286d56c1a68a48"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a46440df1df1597852a286d56c1a68a48">&#9670;&nbsp;</a></span>SGB_ICON_EN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_ICON_EN&#160;&#160;&#160;0x0EU</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Enable/disable ICON functionality </p>

</div>
</div>
<a id="ae4fe10a0c9eca38d126f3a8701e3c9a2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae4fe10a0c9eca38d126f3a8701e3c9a2">&#9670;&nbsp;</a></span>SGB_DATA_SND</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_DATA_SND&#160;&#160;&#160;0x0FU</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Write one or more bytes into SNES Work RAM </p>

</div>
</div>
<a id="a862a450451cfccf138311089b85292fc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a862a450451cfccf138311089b85292fc">&#9670;&nbsp;</a></span>SGB_DATA_TRN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_DATA_TRN&#160;&#160;&#160;0x10U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Transfer code or data into SNES RAM </p>

</div>
</div>
<a id="a70aad9e5786ca8a4753c47583e88f8a2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a70aad9e5786ca8a4753c47583e88f8a2">&#9670;&nbsp;</a></span>SGB_MLT_REQ</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_MLT_REQ&#160;&#160;&#160;0x11U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Request multiplayer mode (input from more than one joypad) </p>

</div>
</div>
<a id="aac4217b88053614f70af5b1f32e72870"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aac4217b88053614f70af5b1f32e72870">&#9670;&nbsp;</a></span>SGB_JUMP</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_JUMP&#160;&#160;&#160;0x12U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Set the SNES program counter and NMI (vblank interrupt) handler to specific addresses </p>

</div>
</div>
<a id="af4d8b611dfdda33039038375ee95f424"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af4d8b611dfdda33039038375ee95f424">&#9670;&nbsp;</a></span>SGB_CHR_TRN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_CHR_TRN&#160;&#160;&#160;0x13U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Transfer tile data (characters) to SNES Tile memory </p>

</div>
</div>
<a id="ac0bf9d5dc54d711fd14f44bf58eaa5db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac0bf9d5dc54d711fd14f44bf58eaa5db">&#9670;&nbsp;</a></span>SGB_PCT_TRN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_PCT_TRN&#160;&#160;&#160;0x14U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Transfer tile map and palette data to SNES BG Map memory </p>

</div>
</div>
<a id="a1762d2df2599cf864400bac4934a5d61"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1762d2df2599cf864400bac4934a5d61">&#9670;&nbsp;</a></span>SGB_ATTR_TRN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_ATTR_TRN&#160;&#160;&#160;0x15U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Transfer data to (color) Attribute Files (ATFs) in SNES RAM </p>

</div>
</div>
<a id="abf8d94c42e97e1ce640340657df70640"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf8d94c42e97e1ce640340657df70640">&#9670;&nbsp;</a></span>SGB_ATTR_SET</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_ATTR_SET&#160;&#160;&#160;0x16U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Transfer attributes from (color) Attribute Files (ATF) to the Game Boy window </p>

</div>
</div>
<a id="a20477d5772564b63de2d151e062dd5a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a20477d5772564b63de2d151e062dd5a7">&#9670;&nbsp;</a></span>SGB_MASK_EN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_MASK_EN&#160;&#160;&#160;0x17U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Modify Game Boy window mask settings </p>

</div>
</div>
<a id="a3b76bf1e9ac81da97c533fa3ab12096c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3b76bf1e9ac81da97c533fa3ab12096c">&#9670;&nbsp;</a></span>SGB_OBJ_TRN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SGB_OBJ_TRN&#160;&#160;&#160;0x18U</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>SGB Command: Transfer OBJ attributes to SNES OAM memory </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="aebb918368f98572ffe4c439854cad191"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aebb918368f98572ffe4c439854cad191">&#9670;&nbsp;</a></span>sgb_check()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> sgb_check </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns a non-zero value if running on a Super GameBoy</p>
<p>Since <a class="el" href="sgb_8h.html#aebb918368f98572ffe4c439854cad191">sgb_check()</a> uses <a class="el" href="sgb_8h.html#a84e1f2ab7dce1faabd3d271b6bf8df8c">sgb_transfer()</a>, the same delay at startup requirement applies to ensure correct operation on PAL SNES. See <a class="el" href="sgb_8h.html#a84e1f2ab7dce1faabd3d271b6bf8df8c">sgb_transfer()</a> for details. </p>

</div>
</div>
<a id="a84e1f2ab7dce1faabd3d271b6bf8df8c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a84e1f2ab7dce1faabd3d271b6bf8df8c">&#9670;&nbsp;</a></span>sgb_transfer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sgb_transfer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>packet</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Transfer a SGB packet</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">packet</td><td>Pointer to buffer with SGB packet data.</td></tr>
  </table>
  </dd>
</dl>
<p>The first byte of <b>packet</b> should be a SGB command, then up to 15 bytes of command parameter data.</p>
<p>See the <code>sgb_border</code> GBDK example project for a demo of how to use these the sgb functions.</p>
<p>When using the SGB with a PAL SNES, a delay should be added just after program startup such as:</p>
<div class="fragment"><div class="line"><span class="comment">// Wait 4 frames</span></div>
<div class="line"><span class="comment">// For PAL SNES this delay is required on startup</span></div>
<div class="line"><span class="keywordflow">for</span> (<a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> i = 4; i != 0; i--) <a class="code" href="gb_8h.html#a815f8ecad32d14b786a8ed1168518773">wait_vbl_done</a>();</div>
<div class="ttc" id="agb_8h_html_a815f8ecad32d14b786a8ed1168518773"><div class="ttname"><a href="gb_8h.html#a815f8ecad32d14b786a8ed1168518773">wait_vbl_done</a></div><div class="ttdeci">void wait_vbl_done(void) PRESERVES_REGS(b</div></div>
<div class="ttc" id="astdint_8h_html_aba7bc1797add20fe3efdf37ced1182c5"><div class="ttname"><a href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a></div><div class="ttdeci">unsigned char uint8_t</div><div class="ttdef"><b>Definition:</b> stdint.h:51</div></div>
</div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><a class="el" href="sgb_8h.html#aebb918368f98572ffe4c439854cad191">sgb_check()</a> </dd></dl>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a0b3366755f3276b0243c1e0497471b7a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0b3366755f3276b0243c1e0497471b7a">&#9670;&nbsp;</a></span>c</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void c</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.14-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
</div>
</body>
</html>
